# -*- coding: utf-8 -*-

import scrapy
# import sys
# reload(sys)
# sys.setdefaultencoding('utf-8')


class simpleUrl(scrapy.Spider):
    name = "simple"
    start_urls = [  
        'https://www.cnblogs.com/ms-uap/p/9928254.html'
    ]

    def parse(self, response):
        page = response.url.split("/")[-2]
        filename = 'mingyan-%s.html' % page
        with open(filename, 'wb') as f:
            f.write(response.body)
        self.log('保存文件: %s' % filename)